﻿using Max.Ph5_2009A.NewShopping.EFCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Max.Ph5_2009A.NewShopping.IRespository
{
    /// <summary>
    /// 工作单元
    /// </summary>
    public interface IUnitOfWork
    {
        /// <summary>
        /// 获取上下文对象
        /// </summary>
        /// <returns></returns>
        PH52009ANewShoppingDbContext GetDbContext();

        /// <summary>
        /// 提交到数据库(同步）
        /// </summary>
        /// <returns></returns>
        int SaveChanges();

        #region 异步方法
        Task<int> SaveChangesAsync();
        #endregion
    }
}
